package com.zgjkhis.modules.system.domain.vo;

import com.zgjkhis.modules.group.DrugNoGroup;
import com.zgjkhis.modules.group.DrugSalePriceGroup;
import com.zgjkhis.modules.group.DrugStatusGroup;
import com.zgjkhis.modules.group.DrugWarnNumGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * @ClassName DrugBatchVO
 * @Deacription 根据id批量修改药品属性
 * @Author yzq
 * @Date 2021/6/24 16:39
 * @Version 1.0
 **/
@Data
public class DrugBatchVO {

    @ApiModelProperty(value = "药品id")
    @NotNull(message = "药品id不能为空",groups = {DrugStatusGroup.class, DrugWarnNumGroup.class,DrugSalePriceGroup.class,DrugNoGroup.class})
    private Long id;
    @ApiModelProperty(value = "预警值")
    @NotNull(message = "预警值不能为空",groups = {DrugWarnNumGroup.class})
    @Min(value=1,message = "预警值必须为正整数",groups={DrugWarnNumGroup.class})
    private Integer warnNum;

    @ApiModelProperty(value = "状态：0：正常，1：失效")
    @NotNull(message = "状态不能为空",groups ={DrugStatusGroup.class})
//    @Pattern(regexp="/^$|^[0-1]{1}$/",message="状态只能是0或者1",groups ={DrugStatusGroup.class})
    private Integer status;

    @ApiModelProperty(value = "零售价")
    @NotNull(message = "零售价不能为空",groups = {DrugSalePriceGroup.class})
    private BigDecimal salePrice;

    @ApiModelProperty(value = "库位号")
    @NotNull(message = "库位号不能为空",groups = {DrugNoGroup.class})
    private String drugNo;
}
